package com.lhkj.ct.meta.modules.common.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.baomidou.mybatisplus.annotation.IEnum;

/**
 * 风险等级
 */
public enum RiskLevel implements IEnum<Integer> {


    NOTHING(0, "暂无"),
    LOWER(1, "较低"),
    MEDIUM(2, "中等"),
    HIGH(3, "较高"),
    VERY_HIGH(4, "极高");

    @EnumValue
    private final int code;

    private final String desc;

    RiskLevel(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    /**
     * 这里重写toString，用于处理BeanUtil.beanToMap的值
     */
    @Override
    public String toString() {
        return desc;
    }

    @Override
    public Integer getValue() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}
